/* ospf_enums.h - OSPF enums */

/* Copyright 2000-2003 Wind River Systems, Inc. */
#include "copyright_wrs.h"

/*
modification history
--------------------
03b,01dec03,agi removed declaration of MD4 and MD5
03a,27sep03,agi ported to Accordion stack, added definitions from RTM,
                updated copyright
02d,29may03,agi added OSPF_MD_ALGORITHM
02c,27may03,agi removed the SPF task, added code inspection changes
02b,09may03,agi added OSPF tasks related enums
02a,22apr03,ram	SPR#76812 Modifications for OSPF performance enhancements
01a,05jun96,cin First Beta Release
*/ 

#if !defined (_OSPF_ENUMS_H_)
#define _OSPF_ENUMS_H_

enum OSPF_RETURN_FLAGS
{
	OSPF_NO_PROBLEM = 0x0,
	OSPF_NO_BUFFERS = 0x1,
	OSPF_BAD_REQUEST = 0x2
};

enum	OSPF_UNION_PACKET_TYPES
{
	OSPF_HELLO_PACKET	= 0x01,
	OSPF_DATABASE_DESCRIPTION_PACKET	= 0x02,
	OSPF_LINK_STATE_REQUEST_PACKET = 0x03,
	OSPF_LINK_STATE_UPDATE_PACKET = 0x04,
	OSPF_LINK_STATE_ACKNOWLEDGEMENT_PACKET = 0x05
};

enum	OSPF_PACKET_STATE
{
	GOOD_RECEIVE = 0x00,
	OSPF_ERROR_ACKNOWLEDGEMENT_BAD = 0x01,
	OSPF_ERROR_ACKNOWLEDGEMENT_DUPLICATE = 0x02,
	OSPF_ERROR_ACKNOWLEDGEMENT_STATE = 0x03,
	OSPF_ERROR_ACKNOWLEDGEMENT_TYPE = 0x04,
	OSPF_ERROR_DATABASE_DESCRIPTION_E_BIT = 0x05,
	OSPF_ERROR_DATABASE_DESCRIPTION_ROUTER_ID = 0x06,
	OSPF_ERROR_DATABASE_DESCRIPTION_STATE = 0x07,
	OSPF_ERROR_DATABASE_DESCRIPTION_TYPE = 0x08,
	OSPF_ERROR_HELLO_E_BIT = 0x09,
	OSPF_ERROR_HELLO_ID = 0x0a,
	OSPF_ERROR_HELLO_MASK = 0x0b,
	OSPF_ERROR_HELLO_ROUTER_DEAD_INTERVAL = 0x0c,
	OSPF_ERROR_HELLO_TIMER = 0x0d,
	OSPF_ERROR_HELLO_VIRTUAL = 0x0e,
	OSPF_ERROR_OSPF_AUTHENTICATION_KEY = 0x0f,
	OSPF_ERROR_OSPF_AUTHENTICATION_TYPE = 0x10,
	OSPF_ERROR_OSPF_INTERFACE_DOWN = 0x11,
	OSPF_ERROR_OSPF_PACKET_TYPE = 0x12,
	OSPF_ERROR_REQUEST_BOGUS = 0x13,
	OSPF_ERROR_REQUEST_EMPTY = 0x14,
	OSPF_ERROR_UPDATE_STATE = 0x15,
	STOP_PROCESSING_PACKET = 0x16,
	/* nssa bit */
	OSPF_ERROR_HELLO_N_BIT = 0x17,
	OSPF_ERROR_DATABASE_DESCRIPTION_N_BIT = 0x18,
    /*opaque lsa error option jkw*/
	OSPF_ERROR_OPAQUE_OPTION = 0x19,
	OSPF_ERROR_DATABASE_DESCRIPTION_MTU_MISMATCH = 0x1a

};

enum	OSPF_NEIGHBOR_EVENT
{
	OSPF_HELLO_RECEIVED = 0x0000,
	OSPF_START = 0x01,
	OSPF_TWO_WAY_RECEIVED = 0x02,
	OSPF_NEGOTIATION_DONE = 0x03,
	OSPF_EXCHANGE_DONE = 0x04,
	OSPF_BAD_LINK_STATE_REQUEST = 0x05,
	OSPF_LOADING_DONE = 0x06,
	OSPF_ADJACENCY_OK = 0x07,
	OSPF_SEQUENCE_NUMBER_MISMATCH = 0x08,
	OSPF_ONE_WAY = 0x09,
	OSPF_KILL_NEIGHBOR = 0x0a,
	OSPF_INACTIVITY_TIMER = 0x0b,
	OSPF_DOWN_INDICATION_FROM_LOWER_LEVEL_PROTOCOLS_RECEIVED = 0x0c
};

enum	OSPF_NEIGHBOR_MODE
{
	OSPF_CLEAR_MODE = 0x00,
	OSPF_SLAVE = 0x01,
	OSPF_MASTER = 0x02,
	OSPF_SLAVE_HOLD = 0x04		/* holding the last database summary delay */
};

enum	OSPF_NEIGHBOR_STATE
{
	OSPF_NEIGHBOR_DOWN = 0x00,
	OSPF_NEIGHBOR_ATTEMPT = 0x01,
	OSPF_NEIGHBOR_INITIALIZING = 0x02,
	OSPF_NEIGHBOR_2_WAY = 0x03,
	OSPF_NEIGHBOR_EXCHANGE_START = 0x04,
	OSPF_NEIGHBOR_EXCHANGE = 0x05,
	OSPF_NEIGHBOR_LOADING = 0x06,
	OSPF_NEIGHBOR_FULL = 0x07
};

enum	OSPF_INTERFACE_EVENT
{
	OSPF_INTERFACE_UP = 0x00,
	OSPF_WAIT_TIMER = 0x01,
	OSPF_BACKUP_SEEN = 0x02,
	OSPF_NEIGHBOR_CHANGE = 0x03,
	OSPF_LOOP_INDICATION = 0x04,
	OSPF_UNLOOP_INDICATION = 0x05,
	OSPF_INTERFACE_DOWN = 0x06
};

enum	OSPF_INTERFACE_STATE
{
	OSPF_INTERFACE_IS_DOWN	= 0x00,
	OSPF_INTERFACE_LOOPBACK = 0x01,
	OSPF_INTERFACE_WAITING = 0x02,
	OSPF_INTERFACE_POINT_TO_POINT = 0x03,
	OSPF_INTERFACE_DESIGNATED_ROUTER_OTHER = 0x04,
	OSPF_INTERFACE_BACKUP_DESIGNATED_ROUTER = 0x05,
	OSPF_INTERFACE_DESIGNATED_ROUTER = 0x06
};

enum	OSPF_INTERFACE_TYPE
{
	OSPF_POINT_TO_POINT = 0x01,
	OSPF_BROADCAST = 0x02,
	OSPF_NBMA = 0x03,
	OSPF_POINT_TO_MULTIPOINT = 0x04,
	OSPF_VIRTUAL_LINK = 0x05
};

enum	OSPF_SEQUENCE_STATE
{
	OSPF_NORMAL = 0x00,
	OSPF_WAITING_FOR_MAXIMUM_SEQUENCE_INSTANCE_TO_BE_FLUSHED = 0x01,
	OSPF_DONE_FLUSHING_MAXIMUM_SEQUENCE_INSTANCE = 0x02
};

/* Link State Types */

enum OSPF_LS_TYPE
{
	OSPF_LS_ROUTER = 0x01,
	OSPF_LS_NETWORK = 0x02,
	OSPF_LS_SUMMARY_NETWORK = 0x03,
	OSPF_LS_SUMMARY_AS_BOUNDARY_ROUTER = 0x04,
	OSPF_LS_AS_EXTERNAL = 0x05,
	/* Interpretation flags in LS_ROUTER for Routers convenience */
#if defined (__NSSA__)
	OSPF_LS_MULTICAST = 0x06,
	OSPF_LS_TYPE_7 = 0x07,
#endif /* __NSSA__ */
    /*opaque lsa new lsa types jkw*/
#if defined (__OPAQUE_LSA__)
    OSPF_LS_TYPE_9 = 0x09,
    OSPF_LS_TYPE_10 = 0x0a,
    OSPF_LS_TYPE_11 = 0x0b,
	OSPF_LS_MAX = 0x0c,
#else /* __OPAQUE_LSA__ */
	OSPF_LS_MAX = 0x08,
#endif /* __OPAQUE_LSA__ */
    OSPF_LS_ROUTER_ABR = 0x0d,
    OSPF_LS_ROUTER_ASBR = 0x0e


};

enum OSPF_ROUTER_LINK_TYPE
{
	OSPF_ROUTER_LINK_TYPE_PPP = 0x1,
	OSPF_ROUTER_LINK_TYPE_TRANSIT_NETWORK = 0x2,
	OSPF_ROUTER_LINK_TYPE_STUB_NETWORK = 0x3,
	OSPF_ROUTER_LINK_TYPE_VIRTUAL = 0x4
};

enum OSPF_ACKNOWLEDGEMENT_RETURN_TYPE
{
	OSPF_NO_ACKNOWLEDGEMENTS_LEFT = 0x00,
	OSPF_ACKNOWLEDGEMENTS_LEFT = 0x01
};

enum OSPF_ROUTING_TABLE_UPDATE_ACTION
{
	OSPF_NO_ACTION = 0x00,
	OSPF_CHANGE_PATH = 0x01,
	OSPF_ADD_PATH = 0x02,
	OSPF_DELETE_PATH = 0x03 /* RTM ### changes */
};

enum OSPF_ROUTE_STATUS
{
	/* No new data under a routing table node or next_hop_block */
	OSPF_ROUTE_IS_NOT_NEW = 0x00,
	/*
	 * New data under a routing table node or next_hop_block.
	 * can be a new next hop block under a routing table node or a new routing table node.
	 * or an old next hop block is not available any more.
	 */
	OSPF_ROUTE_IS_NEW = 0x01,
	/*
	 * This routing table node or next block is no longer available
	 */
	OSPF_ROUTE_IS_NOT_AVAILABLE_NOW = 0x02,
	/*
	 * doesn't matter
	 */
	OSPF_ROUTE_STATUS_DONT_CARE = 0x03
};

enum OSPF_ROUTE_DESTINATION_TYPE
{
	OSPF_DESTINATION_TYPE_NETWORK = 0x00,
	OSPF_DESTINATION_TYPE_ASBR = 0x01,           /* autonomous system border router */
	OSPF_DESTINATION_TYPE_ABR = 0x02,            /* area border router */
	OSPF_DESTINATION_TYPE_VIRTUAL = 0x03,
	OSPF_DESTINATION_TYPE_ASE = 0x04,            /* external to the autonomous system */
	OSPF_DESTINATION_TYPE_WILDCARD = 0xFF
};

enum OSPF_ROUTE_PATH_TYPE
{
	OSPF_ROUTE_PATH_TYPE_INTRA = 0x00,
	OSPF_ROUTE_PATH_TYPE_INTER = 0x01,
	OSPF_ROUTE_PATH_TYPE_1_EXTERNAL = 0x02,
	OSPF_ROUTE_PATH_TYPE_2_EXTERNAL = 0x03,
	OSPF_ROUTE_PATH_TYPE_WILDCARD = 0xFF
};

enum OSPF_COUNTER_ACTION_TYPE
{
	OSPF_INCREMENT_COUNTERS = 0x0,
	OSPF_DECREMENT_COUNTERS = 0x1
};

enum OSPF_PRINTF_GROUPS
{
	OSPF_INTERFACE_PRINTF = 0x0,
	OSPF_NEIGHBOR_PRINTF = 0x1,
	OSPF_MEMORY_PRINTF = 0x2,
	OSPF_ALARM_PRINTF = 0x3,
	OSPF_SNMP_PRINTF = 0x4,
	OSPF_PACKET_PRINTF = 0x5,
	OSPF_ROUTING_TABLE_PRINTF = 0x6,
	OSPF_DEBUG_PRINTF = 0x7,
	OSPF_RTM_PRINTF = 0x08,
	OSPF_PATRICIA_DEBUG_PRINTF = 0x09,
	OSPF_DB_OVERFLOW_PRINTF = 0x0A,
	OSPF_SEARCH_PRINTF = 0x0B,
	OSPF_PROLOGUE_PRINTF = 0x0C
};

enum OSPF_SEARCH_TYPE
{
	OSPF_SEARCH_LSA_TYPE = 0x01,
	OSPF_SEARCH_LSA_ID = 0x02,
	OSPF_SEARCH_ADVERTISING_ROUTER = 0x03
};


enum OSPF_MODE
{
	PASSIVE = 0x00,
	ACTIVE = 0x01
};

typedef signed long seq_t;	/* signed 32 bit number */

typedef enum 
{
	OSPFINVALDLSSEQ	= 0x80000000L,	/* Invalid LS sequence number (reserved or unused) */
	OSPFINITLSSEQ = 0x80000001L,	/* Initial LS Sequence value */
	OSPFMAXLSSEQ = 0x7fffffffL,		/* Maximum LS Sequence value */
	OSPFLSINVALID = 0x80000000L	/* Invalid LS Sequence value */
} SEQNO_T;

/* SPR#76812 */
/* used for routing table indexing*/
enum OSPF_ROUTE_TABLE_TYPE
{
	OSPF_ROUTE_TABLE_NETWORK = 0x00,
	OSPF_ROUTE_TABLE_ROUTER = 0x01,
	OSPF_ROUTE_TABLE_MAX = 0x02
};

typedef enum 
{
    OSPF_TASK_STATE_NOT_CREATED = 0,
    OSPF_TASK_STATE_CREATED,
    OSPF_TASK_STATE_INIT_COMPLETE,
    OSPF_TASK_STATE_RUNNING
} OSPF_TASK_STATES;

typedef enum
{
    OSPF_TASK_TIMER,
    OSPF_TASK_HELLO_TIMER,
    OSPF_TASK_INPUT,
    OSPF_TASK_RTM,
    OSPF_NUM_TASKS
} OSPF_TASKS;


enum OSPF_RTM_ROUTE_PROTOCOL_FAMILY
{
	OSPF_RTM_IP = 0x01,
	OSPF_RTM_IPX = 0x02
};

enum OSPF_RTM_IP_ROUTE_TYPE
    {
	OSPF_RTM_OTHER_ROUTE_TYPE 		= 0x01, 	/* none of the following */
	OSPF_RTM_INVALID_ROUTE_TYPE 		= 0x02, 	/* an invalidated route */
	OSPF_RTM_DIRECT_ROUTE_TYPE 		= 0x03, 	/* route to directly connected (sub-)network */
	OSPF_RTM_INDIRECT_ROUTE_TYPE 	= 0x04 		/* route to a non-local host/network/sub-network */
    };

enum OSPF_RTM_IP_PROTOCOL_VALUE
    {
	OSPF_RTM_RESERVED_PROTOCOL	= 0,
	OSPF_RTM_ICMP_PROTOCOL		= 1,
	OSPF_RTM_IGMP_PROTOCOL		= 2,
	OSPF_RTM_IP_PROTOCOL			= 4,
	OSPF_RTM_TCP_PROTOCOL		= 6,
	OSPF_RTM_IGP_PROTOCOL 		= 9,
	OSPF_RTM_UDP_PROTOCOL		= 17,
	OSPF_RTM_IDRP_PROTOCOL 		= 45,
	OSPF_RTM_RSVP_PROTOCOL 		= 46,
	OSPF_RTM_GRE_PROTOCOL		= 47,
	OSPF_RTM_IPSEC_ESP_PROTOCOL = 50,
	OSPF_RTM_IPSEC_AH_PROTOCOL = 51,
	OSPF_RTM_IGRP_PROTOCOL		= 88,
	OSPF_RTM_OSPF_PROTOCOL		= 89,
	OSPF_RTM_IPIP_PROTOCOL		= 94,
	OSPF_RTM_ETHERIP_PROTOCOL	= 97
    };

enum OSPF_RTM_IP_ROUTE_PROTOCOL_TYPE
    {
	OSPF_RTM_OTHER_ROUTING_PROTOCOL_TYPE 		= 0x01,
	OSPF_RTM_IP_ROUTING_PROTOCOL_TYPE 			= 0x01,		/* RTM_IP_ROUTING_PROTOCOL_TYPE in intentionally defined as 1 as well */
	OSPF_RTM_LOCALLY_CONFIGURED_TYPE 			= 0x02,
	OSPF_RTM_NETWORK_MANAGEMENT_PROTOCOL_TYPE 	= 0x03,
	OSPF_RTM_ICMP_PROTOCOL_TYPE 				= 0x04,
	OSPF_RTM_EGP_PROTOCOL_TYPE 					= 0x05,
	OSPF_RTM_GGP_PROTOCOL_TYPE 					= 0x06,
	OSPF_RTM_HELLO_PROTOCOL_TYPE 				= 0x07,
	OSPF_RTM_RIP_PROTOCOL_TYPE 					= 0x08,
	OSPF_RTM_IS_IS_PROTOCOL_TYPE 				= 0x09,
	OSPF_RTM_ES_IS_PROTOCOL_TYPE 				= 0x0a,
	OSPF_RTM_CISCO_IGRP_TYPE 					= 0x0b,
	OSPF_RTM_BBN_SPF_IGP_TYPE 					= 0x0c,
	OSPF_RTM_OSPF_PROTOCOL_TYPE 				= 0x0d,
	OSPF_RTM_BGP_PROTOCOL_TYPE 					= 0x0e
    };

enum OSPF_RTM_IP_ROUTE_OPERATION
    {
	OSPF_RTM_ADD_IP_ROUTE	= 0x01,
	OSPF_RTM_DELETE_IP_ROUTE	= 0x02
    };

#endif /* _OSPF_ENUMS_H_ */
